public class Main{
    public static void main(String[] args)
    {
        boolean flag = true;
        int count = 0;
        for(int i = 2;i<=100;i++)
        {
            for(int j = 2;j<=Math.sqrt(i);j++) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }
            }
            if(flag)
            {
                System.out.printf("%-5d", i);
                count++;
                if(count%5 == 0)
                {
                    System.out.print("\n");
                }
            }
            flag = true;
        }
    }
}

